package com.slorgs.infrastructure.dto;

import com.gateway.common.model.Api;
import org.springframework.http.HttpStatus;

public class ResponseDTO {
    private Integer code = HttpStatus.OK.value();
    private String message;
    private Object data;

    public ResponseDTO(Integer code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public ResponseDTO(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public static ResponseDTOBuilder builder() {
        return new ResponseDTOBuilder();
    }


    public ResponseDTO() {
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public static class ResponseDTOBuilder {
        private Integer code = HttpStatus.OK.value();
        private String message;
        private Object data;

        public ResponseDTOBuilder code(int code) {
            this.code = code;
            return this;
        }

        public ResponseDTOBuilder message(String message) {
            this.message = message;
            return this;
        }

        public ResponseDTOBuilder data(Object data) {
            this.data = data;
            return this;
        }

        public ResponseDTO build() {
            return new ResponseDTO(this.code, this.message, this.data);
        }
    }
}
